exports.errorHandler = () => {
  return async (ctx, next) => {
    try {
      await next(); // 执行后续中间件
    } catch (err) {
      ctx.status = 500;
      ctx.body = { code: 500, message: err.message || "服务器内部错误" };
    }
  };
};
